
#include<stdio.h>
#include "utils.h"
#include"bamMultiSortCore.h"



int main( int argc , char *argv[])
{



    int i = 0 ;

    init_run_time();

    double time1 = get_run_time();

    int  n =  atoi(argv[argc-1] );
    
    coreInit( argv[1], argv[argc-3] , n);



    for(  i = 1 ; i <  argc - 3  ; i++ ){
        readBam2Vector( argv[i] , 24);
        fprintf(stderr,"Rank %d :%2.f sec\n",i,get_run_time() -time1 );
        time1 = get_run_time();
    }


    Runsort(argv[argc-2], argv[argc-3],24);

    core_destory();

    fprintf(stderr,"Total Time = %2.f sec\n",get_run_time());

    return 0 ;
}


